import request from "@/utils/request";

export function getMaterialByPage(query) {
  return request({
    url: `/system/material/getMaterialByPage`,
    method: "post",
    data: query,
  });
}

// 增加流程模型

export function addMaterial(query) {
  return request({
    url: `/system/material/addMaterial`,
    method: "post",
    data: query,
  });
}
/**
 *
 * @param {*} query
 * @returns
 */
export function delMaterial(query) {
  return request({
    url: `/system/material/delMaterial`,
    method: "post",
    data: query,
  });
}

export function updateMaterial(query) {
  return request({
    url: `/system/material/updateMaterial`,
    method: "post",
    data: query,
  });
}

/**
 * 添加
 * @param {*} query 
 * @returns 
 */
export function addInspectionTemplateMaterial(query) {
  return request({
    url: `/system/inspectionTemplateMaterial/addInspectionTemplateMaterial`,
    method: "post",
    data: query,
  });
}

export function uploadMaterialExcel(params) {
  return request("/system/material/uploadMaterial", {
    method: "POST",
    data: params,
    headers: { "Content-Type": "application/x-www-form-urlencoded" },
  });
}

export async function exportMaterial(params) {
  return request("/system/material/exportMaterial", {
    method: "POST",
    data: params,
    responseType: "blob",
  });
}
